#!/bin/bash

source /usr/local/Ascend/ascend-toolkit/latest/bin/setenv.bash
source /usr/local/Ascend/tfplugin/set_env.sh

rm -rf *.log
rm -rf result.txt

check_tmp="pas"
check="AF-smoke-case-${check_tmp}s"

cat ./autofuse.txt | while read line
do
  line=`echo $line | cut -d " " -f1`
  echo "!!!${line}!!!"
  python3.9 af_smoke.py ${line} 2>&1 | tee ${line}.log
  check_result=`grep ${check} ${line}.log | wc -l`
  if [ "A${check_result}" == "A1" ]; then
    echo "[${line}]: ${check_tmp}s" | tee -a result.txt
  else
    echo "[${line}]: fail" | tee -a result.txt
  fi
done


